package org.jeecg.modules.data.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.data.entity.District;
import org.jeecg.modules.data.entity.DistrictTree;

import java.util.List;

/**
 * @Description: district
 * @Author: jeecg-boot
 * @Date:   2025-02-12
 * @Version: V1.0
 */
public interface IDistrictService extends IService<District> {

    /**
     * 查询信息,并分节点进行显示
     * @return
     */
    List<DistrictTree> queryTreeList(String ids);
    List<DistrictTree> queryTreeList();

    /**
     * 根据区域编码获取内容
     * @param areaName
     */
    District getCityCode(String areaName);

    /**
     * 根据区域名称获取区域编码
     * @param areaName
     */
    District getAreaCode(String areaName);
	/**根节点父ID的值*/
	public static final String ROOT_PID_VALUE = "CN";

	/**树节点有子节点状态值*/
	public static final String HASCHILD = "1";

	/**树节点无子节点状态值*/
	public static final String NOCHILD = "0";




	  /**
	   * 查询所有数据，无分页
	   *
	   * @param queryWrapper
	   * @return List<District>
	   */
    List<District> queryTreeListNoPage(QueryWrapper<District> queryWrapper);

	/**
	 * 根据编码获取父级区域信息
	 * @param code
	 * @return
	 */
	District getParentDistrict(String code);

}
